#include <51func.h>
int main(int argc, char *argv[])
{
    // 父 -> 子
    int fds[2];
    pipe(fds); //先pipe
    if(fork()){// 再fork
        close(fds[0]); // 父进程关闭读端
        write(fds[1],"woqumaijuzile",13);
        wait(NULL);
    }
    else{
        close(fds[1]); // 子进程关闭写端
        char buf[4096] = {0};
        read(fds[0],buf,sizeof(buf));
        printf("I am child, I get message = %s\n", buf);
    }
    return 0;
}

